package com.dding.cms.base.web.util;

public class FileTreeNode extends TreeNode {

	private static final long serialVersionUID = -4194009161696028222L;

	private double size;
	private String time;

	public FileTreeNode( String id,String name) {
		super(name, id);
	}

	public FileTreeNode() {
	}

	public double getSize() {
		return size;
	}

	public void setSize(double size) {
		this.size = size;
	}


	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public void addSize(double size) {
		this.size += size;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(size);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((time == null) ? 0 : time.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FileTreeNode other = (FileTreeNode) obj;
		if (Double.doubleToLongBits(size) != Double
				.doubleToLongBits(other.size))
			return false;
		if (time == null) {
			if (other.time != null)
				return false;
		} else if (!time.equals(other.time))
			return false;
		return true;
	}

}
